<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="../css/stylesite.css" medial="all" />
<link rel="stylesheet" type="text/css" href="../css/styleleft.css" medial="all" />
<link rel="stylesheet" type="text/css" href="../css/mystyle.css" medial="all" />
	<script src="../js/jquery-1.8.2.min.js" ></script>
	<script src="../js/image.js" type="text/javascript"></script>
        <script src="../js/jsearch.js" type="text/javascript"></script>  
	<script type="text/javascript">
	$(function(){
		$(".button a").click(function(){
		$(this).parent().addClass('current');
		$(this).siblings().removeClass('current');
		});
		});
	</script>
	<script src="js/jquery-1.8.2.min.js" ></script>
	<script src="js/image.js" type="text/javascript"></script>
    <script language=JavaScript src="../editor/scripts/innovaeditor.js"></script>
    <script type="text/javascript">
	$(document).ready(function(){
		$('#files').change(function (evt) {
			var f = evt.target.files[0];
			var reader = new FileReader();
	
			if (!f.type.match('image.*')) {
				alert("The selected file does not appear to be an image.");
				return;
			}
	
			reader.onload = function (e) {
				//$('#preview').attr('src', e.target.result);
	
				$('#preview').css("background-image","url("+e.target.result+")");
			};
			reader.readAsDataURL(f);
		});
	});
    </script>
<title>Đăng bài viết</title>

</head>

<body class="pagebody">
	<div id="wrapwebsite" >
				<?php 
			include('../element/header.php');
                       
                        ?>
			<div class="imagestop"></div>
			<div class="wrapmaincontent">
		<?php
                                        
		include('../element/leftside.php');
                include 'Article_model.php';              
		?>
		<div class="center-leftmargin">
                  <div class="moduletitle"><h2> ĐĂNG BÀI VIẾT</h2></div>
		<div class="modulecontent">
                    <?php
                                    ob_start();
                            if (isset($_SESSION['user']))
                            {
                                $User=$_SESSION['user'][1];
                    ?>
        	<form action="Article_controller.php" method="post" id="frmPostArticle" enctype='multipart/form-data'>
            	<table width="708px" border="0" cellspacing="0" cellpadding="0" class="boxtable">
                  <tr>
                    <th scope="row" class="row-first" align="center" width="200px">&nbsp;Tiêu đề</th>
                    <td class="row-next">&nbsp;<input id="txtTitle" name="txtTitle" type="text" size="90" /></td>
                  </tr>
                   <tr>
                    <th scope="row" class="row-first">&nbsp;Hình ảnh</th>
                    <td class="row-next">&nbsp;
                         <div id="upload_panel">
                            <input type='file' name='img' id="files"/>
                            <div id="preview"></div>
                            </div>
                    </td>
                  </tr>
                  <tr>
                    <th scope="row" class="row-first">&nbsp;Nội dung</th>
                    
                    <td class="row-next">&nbsp;<textarea id="txtContent" name="txtContent" cols="70" rows="20" wrap="physical"></textarea>
                  	 <script>
    var oEdit1 = new InnovaEditor("oEdit1");

    oEdit1.width=600;
    oEdit1.height=450;

    /***************************************************
    ADDING CUSTOM BUTTONS
    ***************************************************/

    oEdit1.arrCustomButtons = [["CustomName1","alert('Command 1 here.')","Caption 1 here","btnCustom1.gif"],
    ["CustomName2","alert(\"Command '2' here.\")","Caption 2 here","btnCustom2.gif"],
    ["CustomName3","alert('Command \"3\" here.')","Caption 3 here","btnCustom3.gif"]]


    /***************************************************
    RECONFIGURE TOOLBAR BUTTONS
    ***************************************************/

    //Use standard row toolbar

    oEdit1.toolbarMode = 0;

    oEdit1.features=["Save","FullScreen","Preview","Print", "Search","SpellCheck",
    "Table","AutoTable","Guidelines","Absolute", "Flash","Media","YoutubeVideo","InternalLink","CustomObject",
    "Form","Characters","ClearAll","XHTMLFullSource","XHTMLSource","BRK",
    "Cut","Copy","Paste","PasteWord","PasteText",
    "Undo","Redo","Hyperlink","Bookmark","Image",
    "JustifyLeft","JustifyCenter","JustifyRight","JustifyFull",
    "Numbering","Bullets","Indent","Outdent", "LTR","RTL",
    "Line","RemoveFormat","BRK",
    "StyleAndFormatting","TextFormatting","ListFormatting",
    "BoxFormatting","ParagraphFormatting","CssText","Styles",
    "CustomTag","Paragraph","FontName","FontSize",
    "Bold","Italic","Underline","Strikethrough", "Superscript","Subscript",
    "ForeColor","BackColor",
    "CustomName1","CustomName2","CustomName3"];// => Custom Button Placement


    /***************************************************
    OTHER SETTINGS
    ***************************************************/
    oEdit1.css="style/test.css";//Specify external css file here. If Table Auto Format is enabled, the table autoformat css rules must be defined in the css file.


	/*
    oEdit1.arrStyle = [["body",false,"","font-family:Verdana,Arial,Helvetica;font-size:x-small;"],
          [".ScreenText",true,"Screen Text","font-family:Tahoma;"],
          [".ImportantWords",true,"Important Words","font-weight:bold;"],
          [".Highlight",true,"Highlight","font-family:Arial;color:red;"]];

    If you'd like to set the default writing to "Right to Left", you can use:

    oEdit1.arrStyle = [["BODY",false,"","direction:rtl;unicode-bidi:bidi-override;"]];
    */


    oEdit1.cmdAssetManager = "modalDialogShow('/Editor/assetmanager/assetmanager.php',640,465)"; //Command to open the Asset Manager add-on.
    oEdit1.cmdInternalLink = "modelessDialogShow('links.htm',365,270)"; //Command to open your custom link lookup page.
    oEdit1.cmdCustomObject = "modelessDialogShow('objects.htm',365,270)"; //Command to open your custom content lookup page.

    oEdit1.arrCustomTag=[["First Name","{%first_name%}"],
    ["Last Name","{%last_name%}"],
    ["Email","{%email%}"]];//Define custom tag selection

    oEdit1.customColors=["#ff4500","#ffa500","#808000","#4682b4","#1e90ff","#9400d3","#ff1493","#a9a9a9"];//predefined custom colors

    oEdit1.mode="XHTMLBody"; //Editing mode. Possible values: "HTMLBody" (default), "XHTMLBody", "HTML", "XHTML"

    oEdit1.REPLACE("txtContent");

  </script>


                    </td>
                  </tr>
                  <tr>
                    <th scope="row" class="row-first">&nbsp;Tác giả</th>
                    <td class="row-next">&nbsp;<input id="txtAuthor" name="txtAuthor" type="text" size="90" /></td>
                  </tr>
                  <tr align="center">
                    <td colspan="2">&nbsp;<input name="submit" type="submit" value="Đăng bài" class="button" /><input class="button" name="reset" type="reset" value="Reset" class="button" /></td>
                  </tr>
                </table>

            </form>  
                    <?php }?>
        </div>
		</div>
		</div> 
		
		<?php  include('../element/footer.php'); ?>
</div>
</body>
</html>
